package com.jt.springbootdemo1;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author LiuXu
 * @create 2020-07-28 21:03
 */
@PropertySource(value = {"classpath:/properties/cat.properties"})
@ConfigurationProperties(prefix = "cat")
@Component        //交给spring容器管理
public class Cat {
    private Integer id;
    private String username;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "Cat [id=" + id + ", username=" + username + "]";
    }
}